package day5;

import java.util.Arrays;

public class Demo1 {
    public static void main(String[] args) {
        int[]arr={1,2,3,4,5,18,9};
        int count=0;
        int[]num=new int[arr.length];
        for(int i=0;i<arr.length;i++){
            if(arr[i]%2==0){
                num[count]=arr[i];
                count++;
            }else{
                num[arr.length-1-count]=arr[i];
            }
        }
        System.out.println(Arrays.toString(num));
    }
}
